package cn.juque.datapipeline.api.enums;

import cn.juque.common.constants.BaseMessageEnum;

/**
 * @author juque
 * @version 1.0.0
 * <ul>
 *     <li>DataPipelineMsgEnum</li>
 * </ul>
 * @date 2023-03-30 23:35:35
 **/
public enum DataPipelineMsgEnum implements BaseMessageEnum {

    /**
     * enum
     */
    LOGIN_FAIL("DPP-10000", "用户名或密码错误"),
    FIELD_MAPPING_MISSING("DPP-10001", "映射字段不能为空"),
    DB_TYPE_MISSING("DPP-10002", "数据库类型未知"),
    FILE_EXECUTE_ERROR("DPP-10003", "任务采数执行失败"),
    FILE_PROPERTIES_WRONG("DPP-10004", "文件配置错误"),
    ID_FIELD_MISSING("DPP-10005", "主键列不存在"),
    ;

    private final String code;

    private final String msg;

    DataPipelineMsgEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    /**
     * 消息码
     *
     * @return String
     */
    @Override
    public String getCode() {
        return this.code;
    }

    /**
     * 消息报文
     *
     * @return String
     */
    @Override
    public String getMsg() {
        return this.msg;
    }
}
